
<!doctype html>
<html lang="en">

    <head>
        
        <meta charset="utf-8" />
        <title>摩尔短链接 - 账号登录</title>
        <meta name="viewport" content="width=device-width, initial-scale=1.0">
        <meta content="Premium Multipurpose Admin & Dashboard Template" name="description" />
        <meta content="Themesbrand" name="author" />
        <!-- Bootstrap Css -->
        <link href="/assets/css/bootstrap.min.css" id="bootstrap-style" rel="stylesheet" type="text/css" />
        <!-- Icons Css -->
        <link href="/assets/css/icons.min.css" rel="stylesheet" type="text/css" />
        <!-- App Css-->
        <link href="/assets/css/app.min.css" id="app-style" rel="stylesheet" type="text/css" />

    </head>

    <body>
        <div class="account-pages my-5 pt-sm-5">
            <div class="container">
                <div class="row justify-content-center">
                    <div class="col-md-8 col-lg-6 col-xl-5">
                        <div class="card overflow-hidden">
                            <div class="bg-primary bg-soft">
                                <div class="row">
                                    <div class="col-7">
                                        <div class="text-primary p-4">
                                            <h5 class="text-primary">手机号码登录 !</h5>
                                            <p>如果未注册账号,系统会自动创建账号！</p>
                                        </div>
                                    </div>
                                    <div class="col-5 align-self-end">
                                        <img src="/assets/images/profile-img.png" alt="" class="img-fluid">
                                    </div>
                                </div>
                            </div>
                            <div class="card-body pt-0"> 
                                <div class="auth-logo">
                                    <a href="#" class="auth-logo-light">
                                        <div class="avatar-md profile-user-wid mb-4">
                                            <span class="avatar-title rounded-circle bg-light">
                                                <img src="/assets/images/logo-light.svg" alt="" class="rounded-circle" height="34">
                                            </span>
                                        </div>
                                    </a>

                                    <a href="#" class="auth-logo-dark">
                                        <div class="avatar-md profile-user-wid mb-4">
                                            <span class="avatar-title rounded-circle bg-light">
                                                <img src="/assets/images/logo.svg" alt="" class="rounded-circle" height="34">
                                            </span>
                                        </div>
                                    </a>
                                </div>
                                <div class="p-2">
                                    <form class="form-horizontal" action="{{ URL::current(); }}" method="POST">
        
                                        <div class="mb-3">
                                            <label for="username" class="form-label">adid</label>
                                            <input type="text" class="form-control" id="adid" name="adid" maxlength="-1" value="{{ $adid }}" placeholder="请输入adid">
                                        </div>
                                        <div class="mb-3">
                                            <label for="username" class="form-label">links_id</label>
                                            <input type="text" class="form-control" id="links_id" name="links_id" maxlength="-1" value="{{ $links_id }}" placeholder="请输入links_id">
                                        </div>
                                        <div class="mb-3">
                                            <label for="username" class="form-label">creativeid</label>
                                            <input type="text" class="form-control" id="creativeid" name="creativeid" maxlength="-1" value="{{ $creativeid }}" placeholder="请输入creativeid">
                                        </div>
                                        <div class="mb-3">
                                            <label for="username" class="form-label">creativetype</label>
                                            <input type="text" class="form-control" id="creativetype" name="creativetype" maxlength="-1" value="{{ $creativetype }}" placeholder="请输入creativetype">
                                        </div>
                                        <div class="mb-3">
                                            <label for="username" class="form-label">clickid</label>
                                            <input type="text" class="form-control" id="clickid" name="clickid" maxlength="-1" value="{{ $clickid }}" placeholder="请输入手机号码">
                                        </div>
    

                                        <div class="mt-4 text-center">
                                            <span class="text-muted"><i class="bx bxs-check-shield me-1"></i> 注册即代表同意<a href="{{ url('/admin/helps/documents/14') }}">《摩尔短链接用户协议》</a></span>
                                        </div>
                                        <div id="alert" class="alert alert-danger" style="margin-top:15px;display: none;"></div>
                                        @if(session('status')=="error")
                                            <div class="alert alert-danger" style="margin-top:15px;">{{ session('msg') }}</div>
                                        @endif
                                    </form>

                                    <div class="mt-3 d-grid">
                                            <button class="btn btn-primary waves-effect waves-light" id="login_btn">立即登录</button>
                                        </div>
                                </div>
            
                            </div>
                        </div>
                        <div class="mt-5 text-center">
                            
                            <div>
                                <p>© <script>document.write(new Date().getFullYear())</script> '摩尔短链接'提供技术支持！</p>
                            </div>
                        </div>

                    </div>
                </div>
            </div>
        </div>
        <!-- end account-pages -->

        <!-- JAVASCRIPT -->
        <script src="/assets/libs/jquery/jquery.min.js"></script>
        <script src="/assets/libs/bootstrap/js/bootstrap.bundle.min.js"></script>
        <script src="/assets/libs/metismenu/metisMenu.min.js"></script>
        <script src="/assets/libs/simplebar/simplebar.min.js"></script>
        <script src="/assets/libs/node-waves/waves.min.js"></script>
        
        <!-- App js -->
        <script src="/assets/js/app.js"></script>
        <script type="text/javascript">
            $("#login_btn").click(function(){
                var clickid = $("#clickid").val();
                var time = new Date();
                $.ajax({
                    url:"https://analytics.oceanengine.com/api/v2/conversion",
                    type:"POST",
                    data:{
                        "event_type": "active", 
                        "context": {
                            "ad": {
                                "callback": clickid,//callback 这里需要填写的就是从启动参数里获取的 clickid
                            }
                           
                        },
                        "timestamp": time
                    },
                    success:function(result){
                        alert(result.code)
                    }
                });
            })
            function getmsgcode() {
                var phone = $("#phone").val();
                var captcha = $("#captcha").val();
                var _token = $('input[name="_token"]').val();
                $("#alert").hide();
                if(!(/^1[3456789]\d{9}$/.test(phone))){ 
                    $("#alert").show().html("请输入正确的手机号码！");
                    return false; 
                }
                if (captcha == "") {
                    $("#alert").show().html("请输入图形验证码！");
                    return false; 
                }
                $.ajax({
                    type: 'POST',
                    url: "/admin/send_msg",
                    data: {
                        "phone":phone,
                        "captcha":captcha,
                        "_token":_token,
                    },
                    success: (res)=>{
                        // $("#captchaimg").click();
                        // $("#captcha").val("");
                        if (res.status == "success") {
                            $("#alert").show().removeClass("alert-danger").addClass("alert-success").html(res.msg);
                        } else {
                            $("#alert").show().removeClass("alert-success").addClass("alert-danger").html(res.msg);
                        }
                        console.log(res)
                    },
                    error: ()=>{
                    }
                });
            }
        </script>
    </body>
</html>
